import request from '@/utils/request'

// 查询基金信息列表
export function getFundList(query) {
    return request({
        url: '/fund/queryFundInfoByPage.action',
        method: 'get',
        params: query,
    })
}

// 查询基金分红列表
export function getFundDividendList(query) {
    return request({
        url: '/fund/queryFundDividendByPage.action',
        method: 'get',
        params: query
    })
}

// 查询基金行情列表
export function getFundPricesList(query) {
    return request({
        url: '/fund/queryFundPriceByPage.action',
        method: 'get',
        params: query
    })
}

// 查询指数行情曲线
export function getFundPriceCurve(query) {
    return request({
        url: '/fund/queryFundPriceCurve.action',
        method: 'get',
        params: query
    })
}

// 新增基金信息
export function addFundInfo(data) {
    return request({
        url: '/fund/insertFundInfo.action',
        method: 'post',
        data: data
    })
}

// 修改基金信息
export function updateFundInfo(data) {
    return request({
        url: '/fund/updateFundInfo.action',
        method: 'put',
        data: data
    })
}

// 删除基金信息
export function delFundInfo(data) {
    return request({
        url: '/fund/deleteFundInfo.action',
        method: 'delete',
        data: data
    })
}

// 新增基金分红
export function addFundDividend(data) {
    return request({
        url: '/fund/insertFundDividend.action',
        method: 'post',
        data: data
    })
}

// 修改股票分红
export function updateFundDividend(data) {
    return request({
        url: '/fund/updateFundDividend.action',
        method: 'put',
        data: data
    })
}

// 删除股票分红
export function delFundDividend(data) {
    return request({
        url: '/fund/deleteFundDividend.action',
        method: 'delete',
        data: data
    })
}

// 新增基金行情
export function addFundPrice(data) {
    return request({
        url: '/fund/insertFundPrice.action',
        method: 'post',
        data: data
    })
}

// 修改基金行情
export function updateFundPrice(data) {
    return request({
        url: '/fund/updateFundPrice.action',
        method: 'post',
        data: data
    })
}

// 删除指数行情
export function delFundPrice(data) {
    return request({
        url: '/fund/deleteFundPrice.action',
        method: 'delete',
        data: data
    })
}

// 获取上一交易日
export function getLastWorkDay() {
    return request({
        url: '/fund/getLastWorkday.action',
        method: 'get'
    })
}

